package com.kapcb.log.properties;

import com.google.common.collect.Sets;
import com.kapcb.common.constant.PropertiesConstant;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashSet;
import java.util.Set;

/**
 * <a>Title: LogProperties </a>
 * <a>Author: kapcb <a>
 * <a>Description: LogProperties <a>
 *
 * @author Kpacb
 * @version 1.0
 * @date 2024/5/25 10:11
 * @since 1.0
 */
@Data
@ConfigurationProperties(prefix = PropertiesConstant.PROPERTIES_PREFIX)
public class LogProperties {

    /**
     * 是否开启请求日开关
     */
    private boolean enable = true;

    private boolean enableRequestLog = true;

    private boolean enableResponseLog = true;

    private int maxRequestLogLength = 4096;

    /**
     * 最大请求体长度
     */
    private int maxPayloadLength = 1024 * 512;

    /**
     * 忽略打印日志的请求类型，默认排除上传文件类请求
     */
    private Set<String> ignoreContentTypes = Sets.newHashSet("multipart/form-data");

}
